home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / bc_pas_1.zip / MVSTATE.ASM < prev    next >
Assembly Source File  |  1992-10-07  |  2KB  |  101 lines

  1.  
  2.         page    64,131
  3.     Title    MVSTATE --  Audio Spectrum Sound Support Code
  4.  
  5. ;   /*\
  6. ;---|*|----====< MVSTATE >====----
  7. ;---|*|
  8. ;---|*|  This module maintains the state table and pointer
  9. ;---|*|
  10. ;---|*|  Media Vision, Inc. Copyright (c) 1991,1992. All Rights Reserved.
  11. ;---|*|
  12. ;   \*/
  13.  
  14.     .xlist
  15.     include model.inc
  16.         include masm.inc
  17.     include state.inc
  18.     include common.inc
  19.     .list
  20.  
  21. if MODELSIZE eq 0
  22.     .code
  23. else
  24.     .data
  25. endif
  26.  
  27. ;
  28. ; This pointer points to a state table of hardware variables
  29. ;
  30.         public  mvhwShadowPointer
  31. mvhwShadowPointer    dd    0    ; points to the start of the data table
  32.  
  33. ;
  34. ; These variables mirror the hardware state
  35. ;
  36. HardwareShadowTable    db    (size MVState) dup (0)
  37.  
  38.     .code
  39.  
  40. ;   /*\
  41. ;---|*|---------------====< MVInitStatePtr() >====---------------
  42. ;---|*|
  43. ;---|*| Initializes the state table pointer.
  44. ;---|*|
  45. ;---|*| Entry Conditions:
  46. ;---|*|     None
  47. ;---|*|
  48. ;---|*| Exit Conditions:
  49. ;---|*|     DX:AX point to the state table
  50. ;   \*/
  51.  
  52.     public    MVInitStatePtr
  53. MVInitStatePtr    proc
  54. ;
  55. ; this code can only be processed once per loading
  56. ;
  57.     cmp    wptr [mvhwShadowPointer+2],0    ; have we been here?
  58.     jnz    imvsp_done            ; yes, don't do this again
  59. ;
  60. ; setup a pointer to our local hardware state table
  61. ;
  62.     lea    bx,HardwareShadowTable
  63.     mov    wptr [mvhwShadowPointer+0],bx
  64.     mov    wptr [mvhwShadowPointer+2],ds
  65.  
  66.     mov    [bx._audiomixr],31h    ; lowest filter setting
  67.     mov    [bx._crosschannel],09h    ; cross channel l-2-l, r-2-r
  68. ;
  69. ; find the int 2F interface and if found, use it's state table pointer
  70. ;
  71.     mov    ax,0BC00h        ; MVSOUND.SYS ID check
  72.     mov    bx,'??'
  73.     sub    cx,cx
  74.     sub    dx,dx
  75.  
  76.     int    2fh            ; will return something if loaded
  77.  
  78.     xor    bx,cx
  79.     xor    bx,dx
  80.     cmp    bx,'MV'                 ; is the int 2F interface here?
  81.     jnz    imvsp_done        ; no, exit home
  82.  
  83.     mov    ax,0BC02H        ; get the pointer
  84.         int     2fh
  85.     cmp    ax,'MV'                 ; busy or intercepted
  86.     jnz    imvsp_done
  87.  
  88.     mov    wptr [mvhwShadowPointer+0],bx
  89.     mov    wptr [mvhwShadowPointer+2],dx
  90. ;
  91. imvsp_done:
  92.     mov    ax,wptr [mvhwShadowPointer+0]
  93.     mov    dx,wptr [mvhwShadowPointer+2]
  94.  
  95.         ret
  96.  
  97. MVInitStatePtr    endp
  98.  
  99.     end
  100.  
  101.